home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------- calc_calls.c -------------------------------*/
- /* Copyright 1989 Brown University -- Jeffrey Vogel */
- /*----------------------------------------------------------------------------*/
-
- /*--------------------------------- Includes ---------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- #include "qd_local.h"
-
- /*---------------------------------- SetPt -----------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- void
- SetPt(point, x, y)
- Point *point;
- int x, y;
- {
- /*** error check ***/
- if (!QDrunning) {
- QDerror("ERROR SetPt: QuickDraw not initialized.");
- return;
- }
-
- point->x = x;
- point->y = y;
- }
-
-
-
-
- /*--------------------------------- SetRect ----------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- void
- SetRect(rect, left, top, right, bottom)
- Rect *rect;
- int left, top, right, bottom;
- {
- /*** error check ***/
- if (!QDrunning) {
- QDerror("ERROR SetRect: QuickDraw not initialized.");
- return;
- }
- if (left > right) {
- QDerror("ERROR SetRect: Invalid rectangle specifications.");
- return;
- }
- if (top > bottom) {
- QDerror("ERROR SetRect: Invalid rectangle specifications.");
- return;
- }
-
- rect->left = left;
- rect->top = top;
- rect->right = right;
- rect->bottom = bottom;
- }
-
-
-
-
-
-
-
-
-
- /*-------------------------------- OffsetRect --------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- void
- OffsetRect(rect, dh, dv)
- Rect *rect;
- int dh, dv;
- {
- /*** error check ***/
- if (!QDrunning) {
- QDerror("ERROR OffsetRect: QuickDraw not initialized.");
- return;
- }
-
- rect->left += dh;
- rect->right += dh;
- rect->top += dv;
- rect->bottom += dv;
- }
-
- /*-------------------------------- InsetRect ---------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- void
- InsetRect(rect, dh, dv)
- Rect *rect;
- int dh, dv;
- {
- /*** error check ***/
- if (!QDrunning) {
- QDerror("ERROR InsetRect: QuickDraw not initialized.");
- return;
- }
-
- rect->top += dv;
- rect->bottom -= dv;
- rect->left += dh;
- rect->right -= dh;
- }
-
- /*--------------------------------- PtInRect ---------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- Boolean
- PtInRect(point, rect)
- Point point;
- Rect rect;
- {
- /*** error check ***/
- if (!QDrunning) {
- QDerror("ERROR PtInRect: QuickDraw not initialized.");
- return;
- }
-
- if (point.x < rect.left) return FALSE;
- if (point.x > rect.right) return FALSE;
- if (point.y < rect.top) return FALSE;
- if (point.y > rect.bottom) return FALSE;
-
- return TRUE;
- }
-
-
-
-
-
-